﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AnesSystem.Models;
using Common;

namespace AnesSystem.Util
{
    public class OpeatonNoticeModel
    {
        private string index;
        private PatientLinkModel patientLink;
        private string jhsj;
        private string ssj;
        private string mzys;
        public string Index
        {
            get
            {
                return index;
            }

            set
            {
                index = value;
            }
        }


        public PatientLinkModel PatientLink
        {
            get
            {
                return patientLink;
            }

            set
            {
                patientLink = value;
            }
        }

        public string Jhsj
        {
            get
            {
                if (PatientLink != null && PatientLink.Schedule.Jhsssj != new DateTime())
                {
                    return PatientLink.Schedule.Jhsssj.ToString(DateFormat.DATE_FORMAT_STR_HM);
                }
                return jhsj;
            }

            set
            {
                jhsj = value;
            }
        }

        public string Ssj
        {
            get
            {
                if (PatientLink != null && PatientLink.Schedule.PbtsInt != 0)
                {
                    return PatientLink.Schedule.Pbssjh + "-" + PatientLink.Schedule.PbtsInt;
                }
                return ssj;
            }

            set
            {
                ssj = value;
            }
        }

        public string Mzys
        {
            get
            {
                if (PatientLink != null && PatientLink.Schedule.PbtsInt != 0)
                {
                    if (!string.IsNullOrEmpty(PatientLink.Schedule.Mzysbh1) && !string.IsNullOrEmpty(PatientLink.Schedule.Mzysbh2))
                    {
                        return DataManager.Instance.GetAccountNameByID(PatientLink.Schedule.Mzysbh1) + "," + DataManager.Instance.GetAccountNameByID(PatientLink.Schedule.Mzysbh2);
                    }
                    else
                    {
                        return DataManager.Instance.GetAccountNameByID(PatientLink.Schedule.Mzysbh1);
                    }
                }
                return mzys;
            }

            set
            {
                mzys = value;
            }
        }
    }
}
